﻿Public Class TargetForm

    Private Const OFFSET_HORIZONTAL As Int32 = 48
    Private Const OFFSET_VERTICAL As Int32 = 48

    Private Sub TargetForm_Load(sender As Object, e As EventArgs) Handles Me.Load
        Me.Visible = False
    End Sub


#Region " Public Methods "
    ''' <summary>
    ''' Simulates cursor location placing
    ''' </summary>
    ''' <param name="screenLocation"></param>
    ''' <remarks></remarks>
    Public Sub SetTarget(ByVal screenLocation As Point)
        Me.Left = screenLocation.X - OFFSET_HORIZONTAL
        Me.Top = screenLocation.Y - OFFSET_VERTICAL
        Me.Visible = True
    End Sub

    ''' <summary>
    ''' Simulates left mouse button down
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub LeftDown()
        Me.indicatorLeft.Visible = True
    End Sub

    ''' <summary>
    ''' Simulates left mouse button up
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub LeftUp()
        Me.indicatorLeft.Visible = False
    End Sub

    ''' <summary>
    ''' Simulates middle mouse button down
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub MiddleDown()
        Me.indicatorMiddle.Visible = True
    End Sub

    ''' <summary>
    ''' Simulates middle mouse button up
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub MiddleUp()
        Me.indicatorMiddle.Visible = False
    End Sub

    ''' <summary>
    ''' Simulates right mouse button down
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub RightDown()
        Me.indicatorRight.Visible = True
    End Sub

    ''' <summary>
    ''' Simulates right mouse button Up
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub RightUp()
        Me.indicatorRight.Visible = False
    End Sub

    ''' <summary>
    ''' Simulates button action
    ''' </summary>
    ''' <param name="downButton"></param>
    ''' <param name="buttonNumber"></param>
    ''' <remarks></remarks>
    Public Sub DoButton(ByVal downButton As Boolean, ByVal buttonNumber As Integer)
        Select Case buttonNumber
            Case 0
                'left button
                Me.indicatorLeft.Visible = downButton
            Case 1
                'middle button
                Me.indicatorMiddle.Visible = downButton
            Case Else
                'assume right button
                Me.indicatorRight.Visible = downButton
        End Select
    End Sub

#End Region

End Class